<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="box">
        <button @click="isShow=true">显示模态框</button>
        <div class="main" v-show="isShow" @click.self="isShow=false">
            <div class="container">
                <p>用户名：<input type="text"></p>
                <p>密&emsp;码：<input type="password"></p>
                <hr>
                <p><button>登录</button></p>
            </div>
        </div>
    </div>
    <script>
        var vm = new Vue({
            el : "#box",
            data : {
                isShow : false
            }
        })
    </script>
</body>
</html>